/*
 *  Copyright 2005 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.model.core.statistics;

import com.blandware.atleap.model.core.BaseObject;

import java.util.Date;

/**
 * <p>Represents a visitor session.</p>
 * <p><a href="VisitorSession.java.html"><i>View source</i></a></p>
 *
 * @author Roman Puchkovskiy <a href="mailto:roman.puchkovskiy@blandware.com">
 *         &lt;roman.puchkovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.1 $ $Date: 2006/06/16 15:21:23 $
 */
public class VisitorSession extends BaseObject {

    /**
     * Session number
     */
    protected Integer number;

    /**
     * Number of visits
     */
    protected Integer numberOfVisits;

    /**
     * Session begin date
     */
    protected Date beginDate;

    /**
     * Session end date
     */
    protected Date endDate;

    /**
     * Returns session number.
     *
     * @return number
     */
    public Integer getNumber() {
        return number;
    }

    /**
     * Sets session number.
     *
     * @param number number to set
     */
    public void setNumber(Integer number) {
        this.number = number;
    }

    /**
     * Returns number of visits.
     *
     * @return number of visits
     */
    public Integer getNumberOfVisits() {
        return numberOfVisits;
    }

    /**
     * Sets number of visits.
     *
     * @param numberOfVisits number to set
     */
    public void setNumberOfVisits(Integer numberOfVisits) {
        this.numberOfVisits = numberOfVisits;
    }

    /**
     * Returns session begin date.
     *
     * @return begin date
     */
    public Date getBeginDate() {
        return beginDate;
    }

    /**
     * Sets session begin date.
     *
     * @param beginDate date to set
     */
    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    /**
     * Returns session end date.
     *
     * @return end date
     */
    public Date getEndDate() {
        return endDate;
    }

    /**
     * Sets session end date.
     *
     * @param endDate date to set
     */
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof VisitorSession)) {
            return false;
        }

        final VisitorSession visitorSession = (VisitorSession) o;

        if (number != null
                ? !number.equals(visitorSession.number)
                : visitorSession.number != null) {
            return false;
        }

        return true;
    }

    public int hashCode() {
        return (number != null ? number.hashCode() : 0);
    }
}
